package usw.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import usw.dao.EmployeeDao;
import usw.entity.Employee;
import usw.framework.minidao.entity.MiniDaoPage;

import java.util.List;
import java.util.Map;

/**
 * Created by Mark on 2017/8/18.
 */
@Repository
public class EmployeeService {

    @Autowired
    private EmployeeDao employeeDao;

    /**
     *
     */
    public void sayHello(){
        employeeDao.getCount();
    }

    /**
     *
     * @param employee
     * @return
     */
    public List<Map<String,Object>> getAll(Employee employee)
    {
        return employeeDao.getAll(employee);
    }

    /**
     *
     * @param empno
     * @return
     */
    public Employee getEmployee(String empno)
    {
        return  employeeDao.getEmployee(empno);
    }

    /**
     *
     * @param empno
     * @param name
     * @return
     */
    public Map<String,Object> getMap(String empno, String name)
    {
        return  employeeDao.getMap(empno, name);
    }

    /**
     *
     * @param employee
     * @return
     */
    public int update(Employee employee)
    {
        return  employeeDao.update(employee);
    }

    /**
     *
     * @param employee
     */
    public void insert(Employee employee)
    {
        employeeDao.insert(employee);
    }

    /**
     *
     * @param employee
     * @param page
     * @param rows
     * @return
     */
    public MiniDaoPage<Employee> getAllEmployees(Employee employee, int page, int rows)
    {
        return  employeeDao.getAllEmployees(employee, page, rows);
    }

    /**
     *
     * @return
     */
    public Integer getCount()
    {
        return  employeeDao.getCount();
    }
}
